package com.lcq.study.pdf.jasper;

import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.base.JRBasePrintPage;
import net.sf.jasperreports.engine.export.JRPdfExporter;

import java.util.HashMap;

/**
 * @ClassName JasperReportTest
 * @Description
 * @Author lichuanqi
 * @Date 2022/6/24 10:07
 * @Version 1.0
 **/
public class JasperReportTest {
    public static void main(String[] args) throws JRException {
        HashMap<String, Object> params = new HashMap<>();
        params.put("accountNum","中国建筑东北设计研究院");
        params.put("prjName","东北院项目");
        params.put("fileName","ZH-WJF-YF-33#-S-SG");
        params.put("forecastIndex","颗粒物、光照、微气候、能耗、碳排放");
        params.put("reportDate","2022 年 6 月 8 日");
        String jasperFile = "D:/test/pdf/BPAReport_1.jasper";
        String destFile = "D:/test/pdf/jasper_test.pdf";

        JasperRunManager.runReportToPdfFile(jasperFile, destFile, params, new JREmptyDataSource());

    }
}
